import os
import django
from celery import Celery

# 导入配置文件
os.environ.setdefault('DJANGO_SETTINGS_MODULE', 'seckill.settings')
django.setup()
# 实例化 celery 对象
app = Celery('celery_demo', backend='redis://localhost:6379/1')

app.config_from_object('django.conf.settings')

app.autodiscover_tasks()
# app.autodiscover_tasks(lambda: settings.INSTALLED_APPS)
